<template>
  <div class="login-container">
    <div class="login">
      <!-- 用户头像 -->
      <div class="userpic">
        <img src="../assets/logo.png" alt="">
      </div>
      <!--End 用户头像 -->
      <!-- 表单 -->
      <el-form :model="LoginuserInfo"  :rules="loginRules" ref="loginForm">
        <el-form-item prop="username">
          <el-input placeholder="请输入账户"  v-model="LoginuserInfo.username">
             <i slot="prefix" class="iconfont icon-user"></i>
        </el-input>
        </el-form-item>
         <el-form-item prop="password">
          <el-input :type="ispassword?'password':'text'"  placeholder="请输入密码" v-model="LoginuserInfo.password">
                 <i @click="ispassword=!ispassword"  slot="prefix" :class="['iconfont', ispassword?'icon-lock_fill':'icon-showpassword']" style="color='red'"></i>
          </el-input>
        </el-form-item>
        <el-row>
          <el-col :span="5">
            <el-button @click="islogin" type="primary" >登陆</el-button>
          </el-col>
              <el-col :span="5">
            <el-button @click="reseForm" type="info" >重置</el-button>
          </el-col>
        </el-row>
      </el-form>
      <!-- 表单 -->
    </div>
  </div>
</template>

<script>
import Mix from './login-mixins.js'
export default {
  mixins: [Mix]
}
</script>

<style lang="less" scoped>
.login-container {
  background-color: #24a786fb;
  width: 100%;
  height: 100%;

  // 登陆框
  .login {
    width: 450px;
    height: 300px;
    background-color: #fff;
    position: absolute;
    border-radius: 15px;
    box-shadow: 1px 1px 15px rgba(0, 0, 0, 0.35);
    margin-top: 150px;
    left: 50%;
    transform: translateX(-50%);
    // 用户头像
    .userpic {
      width: 120px;
      height: 120px;
      border: 10px solid #fff;
      box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.34);
      border-radius: 50%;
      background-color: rgb(224, 220, 220);
      position: relative;
      left: 50%;
      transform: translateX(-50%);
      top: -60px;
      overflow: hidden;
      // 图片
      img {
        width: 100%;
      }
    }
    .el-form {
      padding: 20px;
      margin-top: -40px;
      .icon-lock_fill:hover,.icon-showpassword {
      transition: all 0.8s ease;
      color: dodgerblue;
}
    }
    .el-row {
      display: flex;
      justify-content: flex-end;
    }
  }
}
</style>
